holybible.view.FooterView = holybible.view.View.extend({
	TEMPLATE: '<div class="footer"><div class="btnNav"><button id="btnPrev">이전</button><button id="btnNext">다음</button></div><p class="copyright"><a href="http://www.joostory.net" title="JooStory.net">&copy;JooStory</a></p></div>',
	init: function() {
		this._super();
		this.vcode = null;
		this.bcode = null;
		this.nextCnum = null;
		this.prevCnum = null;
	},
	draw: function() {
		this.container = $(this.makeHtml(this.TEMPLATE));
		$(document.body).append(this.container);
		this._super();
		
		this.btnPrev = $("#btnPrev");
		this.btnNext = $("#btnNext");
		this.setEvent();
	},
	setEvent: function() {
		var self = this;
		this.btnPrev.click(function() {
			console.log("prev");
			self.goPrev();
		});
		this.btnNext.click(function() {
			console.log("next");
			self.goNext();
		});
	},
	goPrev: function() {
		showVerses({
			vcode: this.vcode,
			bcode: this.bcode,
			cnum: this.prevCnum
		});
	},
	goNext: function() {
		showVerses({
			vcode: this.vcode,
			bcode: this.bcode,
			cnum: this.nextCnum
		});
	},
	hideNavigation: function() {
		this.btnNext.hide();
		this.btnPrev.hide();
	},
	showNavigation: function(vcode, bcode, cnum) {
		this.btnNext.show();
		this.btnPrev.show();
		
		var book = holybible.model.Book.getInstance().getBook(vcode, bcode);
		if (cnum >= book.cnt) {
			this.btnNext.hide();
		} else {
			this.nextCnum = parseInt(cnum) + 1;
		}
		if (cnum <= 1) {
			this.btnPrev.hide();
		} else {
			this.prevCnum = parseInt(cnum) - 1;
		}
		this.vcode = vcode;
		this.bcode = bcode;
	}
});
